<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>

<html>
    <head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
	
	
	<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<style type="text/css">
		.img{
			height: 40;
		}
		.font{
			color:white;
			font-size: 17px;
		}
		.font1{
			color:white;
			font-size: 30px;
		}
		.round {
		   padding:10px; width:300px; height:50px;
		   border: 0px solid #dedede;
		   -moz-border-radius: 5px;      /* Gecko browsers */
		   -webkit-border-radius: 5px;   /* Webkit browsers */
		   border-radius:5px;            /* W3C syntax */
}
	</style>
	<script type="text/javascript">
		function next(){
			var address=document.getElementById("address").value;
			window.location.href="details.jsp?address="+address;
		}
		function is_return(){
  			window.location.href="index.jsp";
  		}
	</script>
		<script type="text/javascript">
	function disable(id){
		var id2=id;
		var num  = document.getElementById("option").value;
		debugger;
		var paer={id:id2,num:num};
		$.ajax({
			url:"${path}/weixinbassm/Visitor/addUserInformationFist",
			data:paer,
			type:"post",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/weixinbassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误")
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
		<script type="text/javascript">
	function finname(yid){
		var sfzid2=yid;
		var paer={id:sfzid2};
		debugger;
		$.ajax({
			url:"${path}/weixinbassm/Visitor/DeleUserInformationFist",
			data:paer,
			type:"get",
			async:false,
			success:function(date){
				if(date.msg==1){		
					var xq=date.detailed;
					window.location.href = "${path}/weixinbassm/Visitor/visitorsuser3?Celladdress="+xq;
					alert("成功");
				}else{
					alert("错误");
				}
			},
			error:function(){
				alert("异常错误，请联系供应商");
			}
		});
	}
	</script>
	<script type="text/javascript">
		function selce(yaddress){
				var yaddressall=yaddress;
				var phonename=$("#phonename").val();
				var nameonefin=$("#nameonefin").val();
				var phonename1 = phonename.replace(/(^\s*)|(\s*$)/g, '');
				var nameonefin1 = nameonefin.replace(/(^\s*)|(\s*$)/g, '');
				var paer={phonename:phonename1,nameonefin:nameonefin1};
				if(!phonename1==''||!nameonefin1==''){
					window.location.href = "${path}/weixinbassm/Visitor/selectFinPhoneorUserName?phonename="+phonename1+"&nameonefin="+nameonefin1+"&yaddressall="+yaddressall;
				}else{
					alert("搜索条件必须填写一项");
				}
		};
	
	</script>
	<script type="text/javascript">
	 function retuanuser(name){
		 var xq = name;
		 debugger;
		 window.location.href = "${path}/weixinbassm/Visitor/visitorsuser3?Celladdress="+xq;
	 }
	 function seleconetowretun(name){
			debugger;
			var urluser = name;
			window.location.href = "${path}/weixinbassm/Visitor/visitorsuser3?Celladdress="+urluser;
		}
	function Upfinname(id,yaddress){
			var yid=id;
			var address =yaddress;
			window.location.href = "${path}/weixinbassm/Visitor/selectFinPhoneorUserNameLou?yid="+yid+"&yaddress="+address;
	}
	</script>
	
  </head>
  
  <body>
  
  	<div class="container-fluid">
      <div class="row">
        
        	<table border="0" align="center" height="100%">
        	
    	<tr height="20px" bgcolor="#333B46">	
    		<td align="left" width="300px;"><font class="font1"><span >&nbsp;&nbsp;<img src="img/2006707973.jpg" height="20px;"onclick="seleconetowretun('${yaddress}')"/></span></font></td>
    		<td  align="center" width="600px;"><font class="font">搜索用户信息</font>
    		<td align="right"  width="400px;"><font class="font1"><span onclick="is_return()">&nbsp;&nbsp;<img src="img/20170816145600.png" height="20px;" align="top"/>&nbsp;</span></font></td>
    		</td>	
    	</tr>
    	<tr height="40px" bgcolor="#ffffff" >
    		<td width="200px" height="80px" colspan="3" >
 			&nbsp;&nbsp;&nbsp;&nbsp;手机号:<input type="text" id="phonename" name="phonename" style="  width: 100px;  height: 20px;border:0px;border-bottom:#000000 1px solid; color: blue;" ">
  			姓名：<input type="text" id="nameonefin" name="nameonefin" style="width: 100px;  height: 20px; 20px;border:0px;border-bottom:#000000 1px solid;color: blue;">
  			<img src="img/01605511771.jpg" height="20px;" align="top" id="selectdan" onclick="selce('${yaddress}')"/>&nbsp;</span></font>
			</td>
    	</tr>
    	<c:forEach var="v" items="${products}">
    	<tr bgcolor="#F2F3F4">
    		<td align="center"><img alt="" src="${v.yimageurl}" width="80" height="80" style=" border-radius: 45px;" ></td>
    		<td align="left" style="font-size: 15px">
    			姓名:${v.yname}   <img alt="" src="img/1049628162.jpg" width="16" height="15" onclick="Upfinname(${v.yid},'${v.yaddress}')"; align="top"> <br>
    			单元楼:
    			<c:if test="${(v.yunitdoor =='0') }">
					全部<br>
				</c:if>
    			<c:if test="${(v.yunitdoor != '0') }">
    			${v.yunitdoor}<br>
    			</c:if>
    			电话:${v.yphone} <br> 
					<c:if test="${fn:contains(v.yindate,'1') }">
	    				<c:if test="${fn:contains(v.visitorstype,'1') }">
	    				30天
	    				</c:if>
	    				<c:if test="${fn:contains(v.visitorstype,'2') }">
	    				1天
	    				</c:if>
	    			</c:if>
	    			<c:if test="${fn:contains(v.yindate,'0') }">
	    			<select id ="option" name="option">
	    			<option value="1">30天</option>
	    			<option value="2">1天</option>
	    			</select>
	    			</c:if>
	    			    			

				
    		</td>
    		<td align="center">
    				<c:if test="${fn:contains(v.yindate,'1') }">
	    			<button style="width: 80px; height:40px; background-color:#fe6262; color: white; font-size: 12px;" onclick="finname(${v.yid})"id="finname" class="round">禁止</button>
	    			</c:if>
	    			<c:if test="${fn:contains(v.yindate,'0') }">
					 <button style="width: 80px; height:40px; background-color:#27a2f0; color: white; font-size: 12px;" onclick="disable(${v.yid})" id="addbmd"  class="round">允许</button>
	    			</c:if>
    		</td>
    	</tr>
    	</c:forEach>
    	<tr height="20px" bgcolor="#F2F3F4">
    		<td colspan="3" align="center">
    		<c:choose> 
    						<c:when test="${page.pageNow - 1 > 0}"> 
    						 <a href="${path}/weixinbassm/Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow - 1}&yaddressall=${yaddress}&phonename=${phonename}&nameonefin=${nameonefin}"> 
    						<img alt="" src="img/186846180.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow - 1 <= 0}">
    						<a href="${path}/weixinbassm/Visitor/selectFinPhoneorUserName?pageNow=1&yaddressall=${yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
    						<img alt="" src="img/186846180.jpg" height="17px"></a>
    						</c:when>
    		</c:choose> 
    						&nbsp;&nbsp;
    		<c:choose> 
    						<c:when test="${page.totalPageCount==0}"> 
    						<a href="${path}/weixinbassm/Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow}&yaddressall=${yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
    						<img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow + 1 < page.totalPageCount}"> 
    						<a href="${path}/weixinbassm/Visitor/selectFinPhoneorUserName?pageNow=${page.pageNow + 1}&yaddressall=${yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
    						<img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    						<c:when test="${page.pageNow + 1 >= page.totalPageCount}"> 
    						 <a href="${path}/weixinbassm/Visitor/selectFinPhoneorUserName?pageNow=${page.totalPageCount}&yaddressall=${yaddress}&phonename=${phonename}&nameonefin=${nameonefin}">
    						 <img alt="" src="img/1868461829.jpg" height="17px"></a>
    						</c:when>
    		</c:choose> 				
    		</td>
    	</tr> 
  

    </table>
      </div>
    </div>
  </body>
</html>
